﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.views.fountain {
    import flash.display.*;
    import net.wooga.pets.views.components.*;
    import net.wooga.pets.constants.*;
    import net.wooga.pets.utils.*;
    import net.wooga.pets.views.components.controls.*;

    public class TreeView extends AbstractView {

        private var _clip:MovieClip;
        private var _bubble:MovieClip;
        private var _text:SpeechBubbleTextfield;

        public function TreeView(_arg1:String, _arg2:Number, _arg3:Number, _arg4:String=null){
            super(_arg1, _arg2, _arg3, _arg4);
            this._bubble = AssetsLibrary.getMovieClip(SpeechBubbleConstants.TEXT_BUBBLE);
            this._bubble.x = (_arg2 - 15);
            this._bubble.y = (_arg3 - 30);
            this._bubble.scaleX = (this._bubble.scaleY = 0.4);
            this._bubble.mouseEnabled = (this._bubble.mouseChildren = false);
            this._text = new SpeechBubbleTextfield();
            this._bubble.addChild(this._text);
        }
        public function set state(_arg1:String):void{
            this.plant.gotoAndPlay(_arg1);
        }
        public function set symbol(_arg1:String):void{
            Displays.removeChild(this._clip);
            this._clip = AssetsLibrary.getMovieClip((_arg1 + "Plant"));
            var _local2:Number = 0.9;
            this._clip.scaleX = (this._clip.scaleY = _local2);
            this.plant.stop();
            addChild(this._clip);
        }
        public function get bubble():MovieClip{
            return (this._bubble);
        }
        public function set bubbleTime(_arg1:String):void{
            this._text.htmlText = _arg1;
            var _local2:int = ((SpeechBubbleConstants.TREE_BUBBLE_MARGIN_LEFT + this._text.width) + SpeechBubbleConstants.TREE_BUBBLE_MARGIN_RIGHT);
            var _local3:int = ((SpeechBubbleConstants.TREE_BUBBLE_MARGIN_BOTTOM + this._text.height) + SpeechBubbleConstants.TREE_BUBBLE_MARGIN_TOP);
            this._bubble.background.width = _local2;
            this._bubble.background.height = _local3;
            this._text.x = (-(_local2) + SpeechBubbleConstants.TREE_BUBBLE_MARGIN_LEFT);
            this._text.y = ((-(_local3) + SpeechBubbleConstants.TREE_BUBBLE_MARGIN_TOP) + SpeechBubbleConstants.TREE_BUBBLE_OFFSET_TOP);
        }
        private function get plant():MovieClip{
            return ((this._clip.plant as MovieClip));
        }

    }
}//package net.wooga.pets.views.fountain 
